#ifndef _MORSE_H_
#define _MORSE_H_

#include <avr/pgmspace.h>

/* Morse code format */
/* Dash is 1, dot is 0 */
/* All characters start with 1

* C is -.-. represented by 0x0A (0b 0000 1010)
* H is .... represented by 0x00 (0b 0000 0000)
* See the problem?
* thus, we prepend all sequences by 1
* So now,
* C is --.-. represented by 0x1A (0b 0001 1010)
* H is -.... represented by 0x10 (0b 0001 0000)
*/

#define WPM 13

const uint8_t morse[] PROGMEM = {
/* Numbers 1-9,0 */
0b00101111,
0b00100111,
0b00100011,
0b00100001,
0b00100000,
0b00110000,
0b00111000,
0b00111100,
0b00111110,
0b00111111,

/* Letters a-z */
0b00000101, 0b00011000, 0b00011010, 0b00001100,
0b00000010, 0b00010010, 0b00001110, 0b00010000,
0b00000100, 0b00010111, 0b00001101, 0b00010100,
0b00000111, 0b00000110, 0b00001111, 0b00010110,
0b00011101, 0b00001010, 0b00001000, 0b00000011,
0b00001001, 0b00010001, 0b00001011, 0b00011001,
0b00011011, 0b00011100,

 };



extern void sendCode(uint8_t* text, uint8_t *PORT, uint8_t MASK);
extern void doChar(uint8_t evalMe, uint8_t * PORT, uint8_t MASK);

#endif
